#include <iostream>
using namespace std;
class Base
{
protected:
    int x;
public:
    void print()
    {
        cout << "x=" << x << endl;
    }
    Base(int x1)
    {
        x = x1;
        cout << "Base()..." << endl;
    }
};
class Base1 :virtual public Base
{
public:
    Base1(int x1)
        :Base(x1)
    {
        cout << "Base1()..." << endl;
    }
};
class Base2 :virtual public Base
{
public:
    Base2(int x1)
        :Base(x1)
    {
        cout << "Base2()..." << endl;
    }
};
class Derive :public Base1, public Base2
{
public:
    Derive(int x1)
        :Base1(x1)
        , Base2(x1)
        , Base(x1)
    {
        cout << "Derive()..." << endl;
    }
};
int main()
{
    Base1 b1(1);
    b1.print();
    Base2 b2(2);
    b2.print();
    Derive d(3);
    d.print();
    return 0;
}